package com.haima.sage.bigdata.api.entity.auditlog;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

@Converter(autoApply = true)
public class ApiTypeConvert implements AttributeConverter<ApiType, String> {
    @Override
    public String convertToDatabaseColumn(ApiType attribute) {
        return attribute.toString();
    }

    @Override
    public ApiType convertToEntityAttribute(String dbData) {
        return ApiType.getInstance(dbData);
    }
}